module.exports = (error, ctx) => {
    let status = 500;
    switch (error.code) {
        case "10101":
        case "10102":
            status = 401
            break
        case "1001":
            status = 400
            break
        case "1002":
            status = 409
            break
        case "10002": case "10102": case "10005": case "10006":
            status = 207
            break
        default:
            status = 500
    }

    ctx.status = status
    ctx.body = error
}